package com.ego.seckill.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * @author Ares
 * @date 2020-12-17
 */
@Data
@TableName("tb_seckill_sku")
public class SeckillGoods {

    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 秒杀商品的id
     */
    private Long skuId;
    /**
     * 秒杀开始时间
     */
    private Date startTime;
    /**
     * 秒杀结束时间
     */
    private Date endTime;
    /**
     * 原价价格
     */
    private Long price;
    /**
     * 秒杀价格
     */
    private Long seckillPrice;
    /**
     * 商品标题
     */
    private String title;

    /**
     * 商品图片
     */
    private String image;

    /**
     * 是否可以秒杀
     */
    private Boolean enable;

    /**
     * 秒杀库存
     */
//    @JsonIgnore
    @TableField(exist = false)
    private Integer stock;

    //    @JsonIgnore
    @TableField(exist = false)
    private Integer seckillTotal;

    /**
     * 当前服务器时间
     */
    @TableField(exist = false)
    private Date currentTime;




    @Override
    public String toString() {
        return "SeckillGoods{" +
                "id=" + id +
                ", skuId=" + skuId +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", seckillPrice=" + seckillPrice +
                ", title='" + title + '\'' +
                ", image='" + image + '\'' +
                ", enable=" + enable +
                ", stock=" + stock +
                ", seckillTotal=" + seckillTotal +
                '}';
    }
}
